Added session manager.
This commit is contained in:
@@ -69,5 +69,7 @@ typedef void (*deallocator_t) (void*);
|
||||
extern void* Aalloc(unsigned long long sz);
|
||||
extern void Afree(void * mem);
|
||||
extern void register_memory(void* ptr, deallocator_t deallocator);
|
||||
extern void init_session(Context* cxt);
|
||||
|
||||
#define __AQ_NO_SESSION__ void init_session(Context*) {}
|
||||
#endif
|
||||
@@ -25,3 +25,7 @@ void register_memory(void* ptr, deallocator_t deallocator){
|
||||
memmap->operator[](ptr) = deallocator;
|
||||
}
|
||||
|
||||
void init_session(Context* cxt){
|
||||
session = &cxt->current;
|
||||
// session->memory_map = new std::unordered_map<void*, deallocator_t>();
|
||||
}
|
||||
+2
-1
@@ -1,4 +1,5 @@
|
||||
#include "aquery.h"
|
||||
__AQ_NO_SESSION__
|
||||
#include "../server/table.h"
|
||||
|
||||
__AQEXPORT__(ColRef<float>) mulvec(int a, ColRef<float> b){
|
||||
@@ -7,4 +8,4 @@ __AQEXPORT__(ColRef<float>) mulvec(int a, ColRef<float> b){
|
||||
|
||||
__AQEXPORT__(double) mydiv(int a, int b){
|
||||
return a / (double)b;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user