knight/shared/KePlatform.h
author David Anderson <dvander@alliedmods.net>
Fri Aug 15 05:22:26 2008 +0000 (2008-08-15)
changeset 2226 d10b38524be3
child 2471 194be299b700
permissions -rw-r--r--
Landed sourcepawn-1.2. The big changes:

1) JIT compilation/optimization now occurs per-function, and only when functions are first used. We're now officially a whole-method JIT rather than an AOT compiler (albiet, still a simple JIT). This has two implications: Functions are now much better abstracted internally, and loading a plugin is now much less expensive. If a function contains calls to other functions, THOSE functions are only compiled when they're invoked as well.

2) I've removed debug mode. We always show full backtraces now, as there was a very cheap way to implement this which really cleaned up everything. This is great for a number of reasons -- there's less code, the JIT is better designed, we don't need to relocate debug tables, and best of all we no longer have to tell users to enable debug mode at their own expense.
dvander@2226
     1
#ifndef _INCLUDE_KNIGHT_KE_PLATFORM_H_
dvander@2226
     2
#define _INCLUDE_KNIGHT_KE_PLATFORM_H_
dvander@2226
     3
dvander@2226
     4
#if defined WIN32
dvander@2226
     5
dvander@2226
     6
#define KE_PLATFORM_WINDOWS
dvander@2226
     7
#define WINDOWS_LEAN_AND_MEAN
dvander@2226
     8
#include <windows.h>
dvander@2226
     9
#include <malloc.h>
dvander@2226
    10
dvander@2226
    11
#if !defined alloca
dvander@2226
    12
#define alloca _alloca
dvander@2226
    13
#endif
dvander@2226
    14
dvander@2226
    15
#else
dvander@2226
    16
dvander@2226
    17
#define KE_PLATFORM_POSIX
dvander@2226
    18
dvander@2226
    19
#if defined linux
dvander@2226
    20
#define KE_PLATFORM_LINUX
dvander@2226
    21
#else
dvander@2226
    22
#error "TODO"
dvander@2226
    23
#endif
dvander@2226
    24
dvander@2226
    25
#endif
dvander@2226
    26
dvander@2226
    27
#endif //_INCLUDE_KNIGHT_KE_PLATFORM_H_