Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid unneeded copying in ExpandEmitter (needs user control over refcounting) #93

Open
GoogleCodeExporter opened this issue Mar 12, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

It is not possible to avoid copying data in your own implementation of 
ExpandEmitter because there is no way to manually tune the refcounting on 
objects. Example of what I would like:
- seek template
- retain the template
- execute template with as emitter my own emmiter X, emitter X collects all 
data pointers in a struct iovec
- call writev to write all output data
- release the template
(This is to minimize the number of kernel calls)

A solution would be to return a small object which only function would be the 
programmer can indicate explicitly that he is done with the template.

I have looked into it, but I don't know for certain if ctemplate generates 
temporary strings (not from the template and not from the 
datastructures/TemplateDictionaryInterface)), but otherwise a flag to indicate 
it the pointer is temporary (and needs copy if needed outside of the scope of 
that emitter function) in ExpandEmitter would be nice.

I'm willing to contribute, although a few pointers would be nice so I can 
comply with the coding style, etc.

Original issue reported on code.google.com by [email protected] on 29 Jul 2012 at 3:22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant