Added session manager.

This commit is contained in:
2022-09-09 22:15:55 +08:00
parent 9caee2819f
commit 6859671230
12 changed files with 84 additions and 39 deletions
+2
View File
@@ -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
+4
View File
@@ -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
View File
@@ -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;
}
}