Comments (4)
Is this function just a fancy malloc, or is it doing anything else besides allocating?
You can always pretend that the function signature looks different for the current context, see:
coat/include/coat/datastructs/pod_vector.h
Lines 186 to 188 in 7f27e8d
Here, both void* in realloc()'s signature are casted to T*, T being the element type of the vector in this case. So, in COAT, we use T*, but it calls the function which uses void*. You can probably use something very similar.
from coat.
That wouldn't work if you want to write multiple datatypes to the same Buffer. Suppose you have a table of form (uiint64_t, uint32_t, uint8_t).
Then if you want to materialize tuples of this table (to sort for example), I would expect something like the following:
// Buffer store returns a uint8_t*
coat::Ptr<CC, coat::Value<CC, uint8_t>> store_address = coat::FunctionCall(fn, buffer.store_tuple, "tuple_store",16);
// Registers with values to be stored
register0 = coat::Value<CC, uint64_t>(fn, val0);
register1 = coat::Value<CC, uint32_t>(fn, val1);
register2 = coat::Value<CC, uint8_t>(fn, val2);
auto ptr0 = store_address.cast<CC, coat::Value<CC, uint64_t>>();
*ptr0 = register0;
store_address +=8
auto ptr1 = store_address.cast<CC, coat::Value<CC, uint32_t>>();
*ptr1 = register1;
store_address +=4
auto ptr2 = store_address.cast<CC, coat::Value<CC, uint8_t>>();
*ptr2 = register2;
from coat.
Well, then we need a cast function. It was on my todo list anyway. I pushed a change, see the example:
Lines 36 to 42 in 94cc783
from coat.
I just tested it and seems to work. Thanks a lot!
How can one contribute to the project?
from coat.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coat.