4f364e7c95ee7fd9d5bbeddc1940e92405bb0e72Robert Mustacchi * CDDL HEADER START
4f364e7c95ee7fd9d5bbeddc1940e92405bb0e72Robert Mustacchi * The contents of this file are subject to the terms of the
4f364e7c95ee7fd9d5bbeddc1940e92405bb0e72Robert Mustacchi * Common Development and Distribution License (the "License").
4f364e7c95ee7fd9d5bbeddc1940e92405bb0e72Robert Mustacchi * You may not use this file except in compliance with the License.
4f364e7c95ee7fd9d5bbeddc1940e92405bb0e72Robert Mustacchi * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
4f364e7c95ee7fd9d5bbeddc1940e92405bb0e72Robert Mustacchi * or http://www.opensolaris.org/os/licensing.
4f364e7c95ee7fd9d5bbeddc1940e92405bb0e72Robert Mustacchi * See the License for the specific language governing permissions
4f364e7c95ee7fd9d5bbeddc1940e92405bb0e72Robert Mustacchi * and limitations under the License.
4f364e7c95ee7fd9d5bbeddc1940e92405bb0e72Robert Mustacchi * When distributing Covered Code, include this CDDL HEADER in each
4f364e7c95ee7fd9d5bbeddc1940e92405bb0e72Robert Mustacchi * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
4f364e7c95ee7fd9d5bbeddc1940e92405bb0e72Robert Mustacchi * If applicable, add the following below this CDDL HEADER, with the
4f364e7c95ee7fd9d5bbeddc1940e92405bb0e72Robert Mustacchi * fields enclosed by brackets "[]" replaced with your own identifying
4f364e7c95ee7fd9d5bbeddc1940e92405bb0e72Robert Mustacchi * information: Portions Copyright [yyyy] [name of copyright owner]
4f364e7c95ee7fd9d5bbeddc1940e92405bb0e72Robert Mustacchi * CDDL HEADER END
4f364e7c95ee7fd9d5bbeddc1940e92405bb0e72Robert Mustacchi * Copyright (c) 2012, Joyent, Inc. All rights reserved.
4f364e7c95ee7fd9d5bbeddc1940e92405bb0e72Robert Mustacchi * This file implements the private interface with libumem for per-thread
4f364e7c95ee7fd9d5bbeddc1940e92405bb0e72Robert Mustacchi * caching umem (ptcumem). For the full details on how tcumem works and how
4f364e7c95ee7fd9d5bbeddc1940e92405bb0e72Robert Mustacchi * these functions work, see section 8.4 of the big theory statement in
4f364e7c95ee7fd9d5bbeddc1940e92405bb0e72Robert Mustacchi return ((uintptr_t)&curthread->ul_tmem - (uintptr_t)curthread);
4f364e7c95ee7fd9d5bbeddc1940e92405bb0e72Robert Mustacchi * This is called by _thrp_exit() to clean up any per-thread allocations that
4f364e7c95ee7fd9d5bbeddc1940e92405bb0e72Robert Mustacchi * are still hanging around and haven't been cleaned up.
4f364e7c95ee7fd9d5bbeddc1940e92405bb0e72Robert Mustacchi * Since we have something stored here, we need to ensure we declared a
4f364e7c95ee7fd9d5bbeddc1940e92405bb0e72Robert Mustacchi * clean up handler. If we haven't that's broken and our single private
4f364e7c95ee7fd9d5bbeddc1940e92405bb0e72Robert Mustacchi * consumer should be shot.