Code Monkey home page Code Monkey logo

chromium's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chromium's Issues

Is this project still active?

Hey @dirkschulze !
Hope you're doing well :)

I'll get to the point: I see this project has been inactive for a long time. Just wondering: is there still value in keeping this project around? Do we foresee community usage/activity happening around this project? I see issues being filed by the community here... but wondering if we should keep it around.

If yes, can I send some pull requests to update the documentation? At a minimum we need contribution guidelines that reference requiring the signing of Adobe’s CLA.

If no, is it OK if we archive this project? Or even remove it altogether? What are your thoughts?

Thanks for any info.

-Fil

Chromium stack_container for StackString can't work (at least in VisualC++)

Symptoms

I was investigating using the chromium stack_container set specifically the StackString. I made a test program with the following:

#include <chromium/base/stack_container.h>
int main() {
    StackString<300> s;
    return 0;
}

This should create space on the stack and the string would reserve this space.

I was surprised to find, when i added some breakpoints to allocate in StackAllocator that the stack buffer is never returned to anyone. Ie, the general purpose allocater is always called:

pointer allocate(size_type n, void* hint = 0) {
    if (source_ != NULL && !source_->used_stack_buffer_
        && n <= stack_capacity) {
      source_->used_stack_buffer_ = true; // source_ is always NULL
      return source_->stack_buffer();     // and so this is never returned.
    } else {
      return std::allocator<T>::allocate(n, hint); // This is always called.
    }
}

Problem

After further investigation, i found that this is because when the std::basic_string type is created (as part of the construction of StackString) the VisualC++ implementation stores the allocater into some pair. Then when needing to use it, it copies it into a proxy:

void _Alloc_proxy()
	{	// construct proxy
	typename _Alty::template rebind<_Container_proxy>::other
		_Alproxy(_Getal()); // Copies the allocator!
	_Myproxy() = _Unfancy(_Alproxy.allocate(1)); // NOTE this for a later point.
    ...

The copy constructor of the StackAllocator will set the copies stack pointer to NULL. Hence the StackString could never work.

Furthermore, if the StackString didn't have this problem, it immediately allocates space of 1, meaning after you add anything, it will quickly grow and suffer the same problem anyway.

This means the StackString will almost always use normal memory allocation (unless you have a string with 1 char ...).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.